<?php
/*
# ------------------------------------------------------------------------
# JA Job Board Package
# ------------------------------------------------------------------------
# Copyright (C) 2004-2010 JoomlArt.com. All Rights Reserved.
# @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
# Author: JoomlArt.com
# Websites: http://www.joomlart.com - http://www.joomlancers.com.
# ------------------------------------------------------------------------
*/

defined('_JEXEC') or die('Retricted Access');
	global $option;
	$user = JFactory::getUser();
	$user = JFactory::getUser($user->id);
	if ($user->get('lastvisitDate') == "0000-00-00 00:00:00") {
		$lvisit = JText::_( 'Never' );
	} else {
		$lvisit	= generateDate($user->get('lastvisitDate'));
	}
	$user_type = JRequest::getVar('user_type');
?>			
<div class="moduletable job-box">	

<div id="jobboard-content">				
	<form name="userdetailForm" action="<?php echo JURI::root();?>index.php" method="post">
		<?php if (getCurrentUserType()=='Guest') { ?>
		<table class="tabledata userdetails">
			<tr>
				<td>
				
					<?php echo JText::_('You don\'t have update your information detail!'); ?>
					<a class="button" href="<?php echo JRoute::_( 'index.php?option=com_jajobboard&view=usergroup'); ?>"><?php echo JText::_('Update now'); ?></a>
				
				</td>
			</tr>
		</table>
		<?php } ?>
      	<h3>
	          <?php echo JText::_( 'My details' ); ?>
	    </h3>
	    <table class="tabledata userdetails">												
			<tr>
				<td class="key">
					<?php echo JText::_('Name'); ?>
				</td>
				<td>
					<?php echo $user->get('name'); ?>
				</td>
			</tr>
			<tr>
				<td class="key">
					<?php echo JText::_('Username'); ?>
				</td>
				<td>
					<?php echo $user->get('username'); ?>
				</td>
			</tr>
			<tr>
				<td class="key">
					<?php echo JText::_('Email'); ?>
				</td>
				<td>
					<?php echo $user->get('email'); ?>
				</td>
			</tr>
			
			<?php  if( $user->get('id') ) { ?>
			<tr>
				<td class="key">
					<?php echo JText::_('Register Date'); ?>:
				</td>
				<td>
					<?php echo generateDate($user->get('registerDate'));?>
				</td>
			</tr>
			<tr>
				<td class="key">
					<?php echo JText::_('Last Visit Date'); ?>:
				</td>
				<td>
					<?php echo $lvisit; ?>
				</td>
			</tr>
			<?php } ?>
			
		</table>
		<table class="tabledata userdetails">
			<tr>
				<td>
				<?php
				if (JRequest::getVar('view')!='jausergroup')
				{
				?>
					<a class="button" href="<?php echo JRoute::_( 'index.php?option=com_user&view=user&layout=form'); ?>"><?php echo JText::_('Edit'); ?></a>
				<?php
				}
				else 
				{
				?>
					<a class="button" href="<?php echo JRoute::_( 'index.php?option=com_user&view=user&layout=form'); ?>"><?php echo JText::_('Edit'); ?></a>
				<?php 
				}
				?>
				</td>
			</tr>
		</table>
		
		
		<input type="hidden" name="cid" value="<?php echo $user->id; ?>" />
		<input type="hidden" name="option" value="<?php echo $option; ?>" />
		<input type="hidden" name="view" value="usergroup" />
		<input type="hidden" name="task" value="" />
		<?php echo JHTML::_( 'form.token' ); ?>	
		
		        
	</form>
</div>
</div>